package com.raycloud.robot.enums;

import java.util.Objects;
import org.apache.commons.lang.StringUtils;

public enum EnumThreadPoolType{
    COMMON_THREAD_POOL("common_thread_pool","\u673a\u5668\u4eba\u7ebf\u7a0b\u6c60"),DUBBO_SERVER_THREAD_POOL("dubbo_server_thread_pool","dubbo\u670d\u52a1\u63d0\u4f9b\u8005\u7ebf\u7a0b\u6c60");
    private String code;
    private String name;
    public String getCode(){
        return this.code;
    }
    public String getName(){
        return this.name;
    }
    private EnumThreadPoolType(final String code,final String name){
        this.code=code;
        this.name=name;
    }
    public static EnumThreadPoolType getEnum(final String code){
        if(StringUtils.isBlank(code)){
            return null;
        }
        for(final EnumThreadPoolType value : values()){
            if(Objects.equals(value.code,code)){
                return value;
            }
        }
        return null;
    }
}
